package com.design03_behavioral.pattern19_visitor.example02;

import com.design03_behavioral.pattern19_visitor.example01.Product;
import com.design03_behavioral.pattern19_visitor.example01.Visitor;

import java.time.LocalDate;

/**
 * @ClassName Fruit
 * @Description TODO
 * @Author 22963
 * @DATE 2023/9/10 11:39
 */
public class Fruit  extends Product implements Acceptable {

    //重量
    private float weight;

    public Fruit(String name, LocalDate producedDate, double
            price, float weight) {
        super(name, producedDate, price);
        this.weight = weight;
    }
    public float getWeight() {
        return weight;
    }
    public void setWeight(float weight) {
        this.weight = weight;
    }


    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
